drop table spmi_ods.opt_rebate_detail_sum_pt;
CREATE EXTERNAL TABLE IF NOT EXISTS spmi_ods.opt_rebate_detail_sum_pt(
id                                                 bigint                         COMMENT '主键ID',
package_number                                     String                         COMMENT '包数量',
build_package_network_id                           bigint                         COMMENT '建包网点ID',
build_package_network_code                         String                         COMMENT '建包网点CODE',
build_package_network_name                         String                         COMMENT '建包网点名称',
build_package_financial_center_id                  bigint                         COMMENT '建包财务中心ID',
build_package_financial_center_code                String                         COMMENT '建包财务中心CODE',
build_package_financial_center_name                String                         COMMENT '建包财务中心名称',
operation_network_id                               bigint                         COMMENT '操作网点ID',
operation_network_code                             String                         COMMENT '操作财务中心编码',
operation_network_name                             String                         COMMENT '操作网点名称',
start_financial_center_id                          bigint                         COMMENT '始发财务中心ID',
start_financial_center_code                        String                         COMMENT '始发财务中心编码',
start_financial_center_name                        String                         COMMENT '始发财务中心名称',
count_on_num                                       bigint                         COMMENT '票数',
count_on_piece                                     bigint                         COMMENT '件数',
sum_package_charge_weight                          Double                         COMMENT '总计费重量',
sum_settle_weight                                  Double                         COMMENT '总结算重量',
bill_generation_date                               String                         COMMENT '日期',
sum_in_fee_cost                                    Double                         COMMENT '应收',
sum_out_fee_cost                                   Double                         COMMENT '应付',
in_balance_out_fee_cost                            Double                         COMMENT '差额',
build_package_time                                 timestamp                      COMMENT '包牌打印时间',
destination_id                                     bigint                         COMMENT '目的地ID',
destination_code                                   String                         COMMENT '目的地编码',
destination_name                                   String                         COMMENT '目的地名称',
unloading_package_network_id                       bigint                         COMMENT '拆包网点ID',
unloading_package_network_code                     String                         COMMENT '拆包网点编码',
unloading_package_network_name                     String                         COMMENT '拆包网点名称',
unloading_package_financial_center_id              bigint                         COMMENT '拆包财务中心ID',
unloading_package_financial_center_code            String                         COMMENT '拆包财务中心编码',
unloading_package_financial_center_name            String                         COMMENT '拆包财务中心名称',
date_type                                          bigint                         COMMENT '日期类型',
bill_date                                          String                         COMMENT '汇总日期',
create_time                                        timestamp                      COMMENT '创建时间'
)
COMMENT ''
PARTITIONED BY (dt STRING COMMENT '全量快照表 (yyyy-MM-dd)')
STORED AS PARQUET
LOCATION '/dw/hive/spmi_ods.db/external/opt_rebate_detail_sum_pt'
TBLPROPERTIES (
  'parquet.column.index.access'='true'
);